//
//  DetailLike.swift
//  shop
//
//  Created by chen on 2025/5/17.
//

import SwiftUI

struct DetailLike: View {
    
    @ObservedObject var router: Router
    
    @ObservedObject var vm: DetailViewModel
    
    @State private var params: [String:String] = [:]
    
    var body: some View {
        VStack(spacing: 10){
            Text("猜你喜欢")
                .font(.system(size: 16))
                .foregroundStyle(.black)
                .bold()
            
            WaterfallGrid(items: vm.likeGoodsList) { item in
                Button {
                    router.to(.detailView(id: item.id))
                } label: {
                    ProductCard(item: item)
                }
                .buttonStyle(PlainButtonStyle())
            }
        }
        .padding(.vertical, 10)
    }
}

#Preview {
    DetailLike(router: Router.shared, vm: DetailViewModel.shared)
}
